Skip to content

Drive: tự tạo lại thư mục gốc khi ID đã lưu không còn (File not found) - #217

Merged
vieetjk6-afk merged 2 commits into
mainfrom
claude/new-session-z9k46e
Dec 1, 2026
Merged

vieetjk6-afk merged 2 commits into
mainfrom
claude/new-session-z9k46e

Conversation

@vieetjk6-afk

Copy link
Copy Markdown
Owner

Vấn đề

/api/desktop/drive/prepare lỗi lặp lại: File not found: <id>. ID đó là thư mục gốc Drive lưu ở studio_drive.root_folder_id, nhưng thư mục không còn dùng được: đã bị xoá / vào thùng rác, hoặc studio kết nối lại Drive bằng tài khoản Google khác (khi kết nối lại app vẫn giữ ID gốc cũ, và quyền drive.file không thấy thư mục của tài khoản trước). Vì vậy mọi lần tạo thư mục con đều hỏng.

Thay đổi

  • ensureRootFolder: kiểm tra thư mục gốc đã lưu. Nếu Drive trả 404 hoặc thư mục đã vào thùng rác thì xoá ID cũ và tạo lại. Lỗi khác (mạng, quota, 5xx) coi như thư mục vẫn còn, để không tạo gốc trùng.
  • Route prepare: bắt lỗi Drive, trả JSON drive_failed: … (502) thay vì 500 không xử lý.

Lưu ý

  • Hợp đồng đã có drive_folder_id trỏ vào cây cũ vẫn giữ nguyên, bản này không tạo lại.
  • Đã qua tsc và eslint; chưa chạy thử với tài khoản Drive thật.

Generated by Claude Code

/api/desktop/drive/prepare lỗi lặp 'File not found: <rootId>' khi
studio_drive.root_folder_id trỏ tới thư mục đã xoá / vào thùng rác / thuộc
tài khoản Google trước đó. ensureRootFolder giờ soi thư mục gốc, mất thật
(404 hoặc trashed) thì tạo lại. Route prepare bắt lỗi Drive trả JSON 502.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwYcd2Ld9VVBksLHmVsmpj
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
7c1184b 2026-12-01T05:01:01.994Z View logs ↗

Vòng theo dõi 10s gọi lại /api/desktop/drive/prepare liên tục cho hợp đồng
lỗi (416 lần trong nhật ký lỗi). Bấm tay vẫn hỏi lại ngay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwYcd2Ld9VVBksLHmVsmpj
@vieetjk6-afk
vieetjk6-afk merged commit 0c2e714 into main Dec 1, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants